Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YUNIKORN-2446] Add OCI annotations to public docker images #889

Closed
wants to merge 6 commits into from

Conversation

ryankert01
Copy link
Contributor

@ryankert01 ryankert01 commented Aug 12, 2024

What is this PR for?

source: apache/yunikorn-web#174 (comment)

OCI annotations: https://github.com/opencontainers/image-spec/blob/main/annotations.md

I believe most Yunikorn users are using the docker images into which we push, and so we should consider following a public protocol to set attributions for our public images.

org.opencontainers.image.title="yunikorn-scheduler-k8s"
org.opencontainers.image.description="Apache Yunikorn"
org.opencontainers.image.created="${build_date}"
org.opencontainers.image.source="https://github.com/apache/yunikorn-k8shim"
org.opencontainers.image.url="https://hub.docker.com/r/apache/yunikorn"
org.opencontainers.image.revision="${build_revision}"
org.opencontainers.image.license="Apache-2.0"
org.opencontainers.image.documentation="https://yunikorn.apache.org"

Reference:
[1] Annotations and Labels in Container Images
[2] OCI annotation spec

What type of PR is it?

  • - Bug Fix
  • - Improvement
  • - Feature
  • - Documentation
  • - Hot Fix
  • - Refactoring

Todos

  • - Task

What is the Jira issue?

https://issues.apache.org/jira/browse/YUNIKORN-2446

How should this be tested?

Make all 3 images

make image

Inspect if oci annotations is added into config.labels

docker image inspect --format='{{json .Config.Labels}}' apache/yunikorn:scheduler-amd64-latest | jq
docker image inspect --format='{{json .Config.Labels}}' apache/yunikorn:scheduler-plugin-amd64-latest | jq
docker image inspect --format='{{json .Config.Labels}}' apache/yunikorn:admission-amd64-latest | jq

Screenshots (if appropriate)

image

Questions:

  • - The licenses files need update.
  • - There is breaking changes for older versions.
  • - It needs documentation.

@ryankert01 ryankert01 marked this pull request as draft August 12, 2024 13:42
@ryankert01 ryankert01 marked this pull request as ready for review August 12, 2024 13:48
Copy link
Contributor

@craigcondit craigcondit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is sound.

I think we should add org.opencontainers.image.version to match our existing Version label as well.

We also should update image.source and image.url to be sourced from environment variables to allow customizing these as part of release builds. We don't want this metadata embedded if usera are generating custom binaries.

Finally, please open a parallel PR for the yunikorn-web repo so that we get that updated as well.

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Copy link

codecov bot commented Aug 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.07%. Comparing base (286abb6) to head (48ede8c).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #889   +/-   ##
=======================================
  Coverage   68.07%   68.07%           
=======================================
  Files          70       70           
  Lines        7575     7575           
=======================================
  Hits         5157     5157           
  Misses       2203     2203           
  Partials      215      215           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ryankert01
Copy link
Contributor Author

Thanks @craigcondit for the review! I also add more variables to increase consistency and reusability.

Copy link
Contributor

@craigcondit craigcondit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable to me. @wilfred-s can you take a look as well?

@craigcondit craigcondit self-requested a review August 12, 2024 23:31
Copy link
Contributor

@craigcondit craigcondit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved (tentatively pending Wilfred's comments)

Copy link
Contributor

@pbacsko pbacsko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryankert01 thanks for this patch. LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants